package com.qf.controller;

import com.qf.entity.Grade;
import com.qf.entity.Users;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * 2019/10/9
 * Administrator
 * springboot1009
 * 面向对象面向君  不负代码不负卿
 */
@RestController  //等价于@ResponseBody+@Controller
public class TestController {
    @RequestMapping("/test")
    public String test1(){
        System.out.println("test1----");
        return "success";
    }


    @RequestMapping("/test2")
    public Users test2(){
        Users users = new Users(1, "张三", new Date());
        Grade grade=new Grade(1,"一年级");
        users.setGrade(grade);

        System.out.println("aaaa1111");
        
        return users;
    }
}
